#pragma once
#include"global_var.cpp"
#include"gate.cpp"
class fault
{
public:
    gate* fe_gate = nullptr;
    std::size_t fe_port = 0;        //only when fe_cell != nullptr
    std::size_t fe_pi_po = 0;       //hashed PI/PO name
    char polarity;
    char is_input = 0;  //is PI or is input port 
    char state = 0;     //0->not detected , 1->potential detected , 2->detected
    
    std::vector<std::pair<gate*,std::array<char,10>>> changed_dff;
    int changed_dff_size = 0;

    std::vector<std::tuple<gate*,char*,char*,bool>> affected; // affected gate , target_bit, source_bit, is_PI

    std::string name = "";
    std::vector<std::string> equal_faults;
};
